import json
from models import BaseModels
from sqlalchemy import Column, BigInteger, DateTime, String, ForeignKey, JSON, Integer, Boolean


class Templog(BaseModels):
    __tablename__ = 'templog'
    id = Column(BigInteger, autoincrement=True, primary_key=True, unique=True, nullable=False)
    time = Column(DateTime, index=True, comment="记录创建时间")
    sequence = Column(String(64), index=True, comment="产品序列SN")
    ft_id = Column(Integer, ForeignKey("facility.id", ondelete='CASCADE'), index=True, comment="设备ID")
    index = Column(Integer, comment="顺序卡槽")
    message = Column(JSON, comment="信息汇总")
    useful = Column(Boolean, comment="是否使用过")



